<!DOCTYPE html>
<html>
<head>
    <script>
        var _czc = _czc || [];
        _czc.push(["_setAccount", "{$cnzz}"]);

        function cnzz_pus(friend) {
            _czc.push(["_trackEvent",'分享',friend,'index','','index']);
        }
    </script>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0'/>
    <meta name='apple-mobile-web-app-capable' content='yes'>
    <meta name='apple-mobile-web-app-status-bar-style' content='black'>
    <meta name='format-detection' content='telephone=no'>

    <link href='//res.wx.qq.com/mpres/htmledition/images/favicon218877.ico' rel='Shortcut Icon'>
    <script src='//res.wx.qq.com/open/js/jweixin-1.0.0.js'></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
    <!-- body 最后 -->
    <script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script>


    <style>
        .bon{
            background: #ed382a;
            width: 97%;
            margin: 10px auto;
            text-align: center;
            height: 40px;
            line-height: 40px;
            color: #deea1d;
            border-radius: 5px;

        }
        body{font-size: 17px;font-family: -apple-system-font, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif}
        .fxtp{
            top:2%;
            height: 100%;
            margin:0 auto;left: 0;text-align: center; right: 0;
            /*display:none;*/
            opacity: 1;
            visibility: visible;
            z-index:99999;
        }
        .fxtp img{
            display: block;
            text-align: center;
            margin: 0 auto;
        }
        .bottom-center{
            color:#FF0000;
            text-align: center;
        }
        #fxt{

        }
        .tips{
            color:#000;font-size:18px;font-weight:300;
            padding:30px 0 0;
        }
        .order {
            height: 60px;
            line-height: 60px;
            text-align: center;
        }
        .order .line {
            display: inline-block;
            width: 30%;
            border-top: 1px dashed #ccc ;
        }
        .order .txt {
            font-size: 14px;
            color: #a59898;
            line-height: 20px;
        }
        .media_tool_meta i {
            vertical-align: 0;
            position: relative;
            top: 8px;
            margin-right: 3px;
        }
    </style>
</head>
<body id='activity-detail' class='zh_CN ' ontouchstart=''>
<div id="fxt" class="fxtp">
    <div class="tips" style="font-size: 15px;margin-bottom: 10px;font-weight: 500;">
        <p style="text-align: left;margin-left: 20px;color: red;">温馨提示:</p>
        <p style="text-align: left;margin-left: 20px;">长按下图,选择
            <eq name="is_share" value="1">
                <span style="color:red;">发送给朋友-分享到群</span>
                <span style="color: #1d1c1d;">才可观看后续章节！</span>
            </eq>
            <neq name="is_share" value="1">
                <span style="color:red;">保存到手机-分享到朋友圈</span>
                <span style="color: #1d1c1d;">立即观看后续章节！</span>
            </neq>
        </p>
    </div>
    <div id='d-pic' style='margin: 0 auto;text-align: center;border:10px solid #fdf0b9;width:70%;border-radius: 10px;'>
        <img src='{$pic}' id='pic' style='margin: 0 auto;width:100%;'>
    </div>
    <div class="bottom-center">
        <strong>
            <eq name="is_share" value="1">
                <p style="color:black;font-size:18px;font-weight: 400;margin-top: 10px;margin-bottom: 10px;">[长按上图保存<span style="color:red;">分享到群</span>]</p>
            </eq>
            <neq name="is_share" value="1">
                <p style="color:black;font-size:18px;font-weight: 400;margin-top: 10px;margin-bottom: 10px;">[长按上图保存<span style="color:red;">分享到朋友圈</span>]</p>
            </neq>
        </strong>
    </div>
</div>
<eq name="is_share" value="1">
    <script language="Javascript">
        var hiddenProperty = 'hidden' in document ? 'hidden' :  'webkitHidden' in document ? 'webkitHidden' :  'mozHidden' in document ? 'mozHidden' : null;
        var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
        var aaa=0;
        var onVisibilityChange = function(){
            if (!document[hiddenProperty]) {
                console.log('页面非激活');
                if(aaa==0){
                    confirm();
                    return false;
                }else{
                    ok();
                }
            }else{
                console.log('页面激活');
            }
        };
        document.addEventListener(visibilityChangeEvent, onVisibilityChange);

        function confirm(){
            rd = parseInt(Math.random()*100);
            if(rd >50){
                ok();
            }else{
                $.modal({
                    title: "<span style='color: green;'>分享失败</span>",
                    text: '分享失败，请您长按图片选择<span style="color: red;">发送给朋友-分享到群</span>，即可阅读后续章节！',
                    buttons: [
                        {
                            text: "<span>确定</span>", onClick: function(){
                                aaa++;
                            }
                        }
                    ]
                });
                cnzz_pus('分享成功');
            }
        }
        function ok() {
            $.modal({
                title: "<span style='color: green;'>分享成功</span>",
                text: '恭喜您分享成功，点击确定立即观看下一章节',
                buttons: [
                    {
                        text: "<span>确定</span>", onClick: function(){
                            location.href='{$go_url}';
                        }
                    }
                ]
            });
            cnzz_pus('分享成功');
        }
    </script>
</eq>
<div style='display:none'>
    <script src="https://s4.cnzz.com/z_stat.php?id={$cnzz}&web_id={$cnzz}" language="JavaScript"></script>
</div>
</body>
</html>